﻿namespace Forms
{
    using Forms.My;
    using Forms.My.Resources;

    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;

    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class frmKontenrundruf : Form
    {
        [AccessedThroughProperty("AbortButton")]
        private Button _AbortButton;
        [AccessedThroughProperty("lstKontenrundruf")]
        private ListView _lstKontenrundruf;
        [AccessedThroughProperty("ProgressImage")]
        private PictureBox _ProgressImage;
        [AccessedThroughProperty("TheTimer")]
        private Timer _TheTimer;
        [AccessedThroughProperty("txtDebug")]
        private Label _txtDebug;
        [AccessedThroughProperty("txtStatus")]
        private Label _txtStatus;
        [AccessedThroughProperty("webB")]
        private WebBrowser _webB;
        private string ActualKonto;
        private int ActualStep;
        private IContainer components;
        private int CurrentBMWHeaderID;
        private int ErrBridgeCounter;
        internal List<KontenRundrufData> KontenRundrufListe;

        internal frmKontenrundruf()
        {
            base.FormClosing += new FormClosingEventHandler(this.frmKontenrundruf_FormClosing);
            base.Load += new EventHandler(this.frmKontenrundruf_Load);
            this.KontenRundrufListe = new List<KontenRundrufData>();
            this.CurrentBMWHeaderID = -1;
            this.ErrBridgeCounter = 0;
            this.InitializeComponent();
        }

        private void AbortButton_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing && (this.components != null))
                {
                    this.components.Dispose();
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }

        private void frmKontenrundruf_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.TheTimer.Enabled = false;
        }

        private void frmKontenrundruf_Load(object sender, EventArgs e)
        {
            this.ActualStep = 1;
            this.TheTimer.Enabled = true;
            this.CurrentBMWHeaderID = -1;
            this.webB.DocumentText = "";
            this.AbortButton.Text = "Abbrechen";
            this.txtStatus.Text = "";
            DataRow[] rowArray = MyProject.Forms.Main.cs.Table_BMW_Debitorenkonten.Select("Abrufen=True", "Deb_Kto_Nr", DataViewRowState.CurrentRows);
            this.KontenRundrufListe.Clear();
            this.lstKontenrundruf.Clear();
            this.lstKontenrundruf.Columns.Add("Konto", 100, HorizontalAlignment.Left);
            this.lstKontenrundruf.Columns.Add("Bezeichnung", 200, HorizontalAlignment.Left);
            this.lstKontenrundruf.Columns.Add("Status", 200, HorizontalAlignment.Left);
            foreach (DataRow row in rowArray)
            {
                KontenRundrufData data = new KontenRundrufData();
                KontenRundrufData data2 = data;
                data2.Konto = Conversions.ToString(row["Deb_Kto_Nr"]);
                data2.Bezeichnung = Conversions.ToString(row["Bezeichnung"]);
                data2.Fehler = false;
                data2.Done = false;
                data2 = null;
                this.KontenRundrufListe.Add(data);
                ListViewItem item = new ListViewItem(data.Konto);
                item.UseItemStyleForSubItems = false;
                item.SubItems.Add(data.Bezeichnung);
                item.SubItems.Add("warte auf Abruf");
                this.lstKontenrundruf.Items.Add(item);
            }
        }

        private object IdentifySite(string TagName, string TagAttribute, string TagValue)
        {
            object obj2;
            try
            {
                if (this.webB.Document.GetElementById(TagName).GetAttribute(TagAttribute) == TagValue)
                {
                    return true;
                }
                obj2 = false;
            }
            catch (NullReferenceException exception1)
            {
                ProjectData.SetProjectError(exception1);
                NullReferenceException exception = exception1;
                obj2 = false;
                ProjectData.ClearProjectError();
            }
            return obj2;
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            this.components = new Container();
            this.txtDebug = new Label();
            this.lstKontenrundruf = new ListView();
            this.TheTimer = new Timer(this.components);
            this.ProgressImage = new PictureBox();
            this.txtStatus = new Label();
            this.webB = new WebBrowser();
            this.AbortButton = new Button();
            ((ISupportInitialize) this.ProgressImage).BeginInit();
            this.SuspendLayout();
            this.txtDebug.AutoSize = true;
            this.txtDebug.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
            this.txtDebug.ForeColor = Color.FromArgb(0xff, 0x80, 0x80);
            Point point = new Point(12, 0x27c);
            this.txtDebug.Location = point;
            this.txtDebug.Name = "txtDebug";
            Size size = new Size(0x75, 13);
            this.txtDebug.Size = size;
            this.txtDebug.TabIndex = 12;
            this.txtDebug.Text = "Debug-Modus aktiv";
            this.txtDebug.Visible = false;
            this.lstKontenrundruf.AllowColumnReorder = true;
            this.lstKontenrundruf.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            point = new Point(12, 12);
            this.lstKontenrundruf.Location = point;
            this.lstKontenrundruf.Name = "lstKontenrundruf";
            size = new Size(960, 0x250);
            this.lstKontenrundruf.Size = size;
            this.lstKontenrundruf.Sorting = SortOrder.Ascending;
            this.lstKontenrundruf.TabIndex = 11;
            this.lstKontenrundruf.UseCompatibleStateImageBehavior = false;
            this.lstKontenrundruf.View = View.Details;
            this.TheTimer.Interval = 0x3e8;
            this.ProgressImage.Image = Resources.ProgressBar;
            point = new Point(12, 610);
            this.ProgressImage.Location = point;
            this.ProgressImage.Name = "ProgressImage";
            size = new Size(0x356, 20);
            this.ProgressImage.Size = size;
            this.ProgressImage.SizeMode = PictureBoxSizeMode.CenterImage;
            this.ProgressImage.TabIndex = 10;
            this.ProgressImage.TabStop = false;
            this.txtStatus.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom;
            point = new Point(12, 0x279);
            this.txtStatus.Location = point;
            this.txtStatus.Name = "txtStatus";
            size = new Size(0x356, 0x12);
            this.txtStatus.Size = size;
            this.txtStatus.TabIndex = 9;
            this.txtStatus.TextAlign = ContentAlignment.MiddleCenter;
            this.webB.AllowWebBrowserDrop = false;
            this.webB.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            this.webB.IsWebBrowserContextMenuEnabled = false;
            point = new Point(12, 12);
            this.webB.Location = point;
            size = new Size(20, 20);
            this.webB.MinimumSize = size;
            this.webB.Name = "webB";
            this.webB.ScriptErrorsSuppressed = true;
            size = new Size(960, 0x250);
            this.webB.Size = size;
            this.webB.TabIndex = 8;
            this.webB.WebBrowserShortcutsEnabled = false;
            this.AbortButton.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            point = new Point(0x368, 0x273);
            this.AbortButton.Location = point;
            this.AbortButton.Name = "AbortButton";
            size = new Size(100, 0x19);
            this.AbortButton.Size = size;
            this.AbortButton.TabIndex = 7;
            this.AbortButton.Text = "Abbrechen";
            this.AbortButton.UseVisualStyleBackColor = true;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x3d8, 0x298);
            this.ClientSize = size;
            this.Controls.Add(this.txtDebug);
            this.Controls.Add(this.lstKontenrundruf);
            this.Controls.Add(this.ProgressImage);
            this.Controls.Add(this.txtStatus);
            this.Controls.Add(this.webB);
            this.Controls.Add(this.AbortButton);
            this.Name = "frmKontenrundruf";
            this.Text = "BMW-Bank-Kontenrundruf";
            ((ISupportInitialize) this.ProgressImage).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();
        }

        private void SetListViewItem(string KontoNum, string Status, int color)
        {
            IEnumerator enumerator = this.lstKontenrundruf.Items.GetEnumerator();
            try
            {
                
                while (enumerator.MoveNext())
                {
                    ListViewItem current = (ListViewItem) enumerator.Current;
                    if (current.Text == KontoNum)
                    {
                        current.SubItems[2].Text = Status;
                        switch (color)
                        {
                            case 0:
                                current.SubItems[2].BackColor = Color.White;
                                break;

                            case 1:
                                current.SubItems[2].BackColor = Color.YellowGreen;
                                break;

                            case 2:
                                current.SubItems[2].BackColor = Color.LightCoral;
                                break;
                        }
                    }
                }
            }
            finally
            {
                if (enumerator is IDisposable)
                {
                    (enumerator as IDisposable).Dispose();
                }
            }
        }

        private void ShowUnexpectedSiteError()
        {
            this.TheTimer.Enabled = false;
            if (Interaction.MsgBox("Detalierter Fehlerbericht nicht möglich. Neuer Versuch?", MsgBoxStyle.Exclamation | MsgBoxStyle.YesNo, "Seitenladefehler") == MsgBoxResult.Yes)
            {
                this.ActualStep = 1;
                this.TheTimer.Enabled = true;
            }
            else
            {
                this.ActualStep = 0;
                this.Close();
            }
        }

        private void ShowUnexpectedSiteError(NullReferenceException ex)
        {
            string str = "Detalierter Fehlerbericht: \n" + ex.Source + " verursachte die Ausnahme.\n\n" + ex.StackTrace;
            
            this.TheTimer.Enabled = false;
            if (Interaction.MsgBox(str, MsgBoxStyle.Exclamation | MsgBoxStyle.YesNo, "Seitenladefehler") == MsgBoxResult.Yes)
            {
                this.ActualStep = 1;
                this.TheTimer.Enabled = true;
            }
            else
            {
                this.ActualStep = 0;
                this.Close();
            }
        }

        private void TheTimer_Tick(object sender, EventArgs e)
        {
            if ((!this.webB.IsBusy & (this.webB.ReadyState == WebBrowserReadyState.Complete)) | ((this.webB.ReadyState == WebBrowserReadyState.Uninitialized) & (this.ActualStep == 1)))
            {
                switch (this.ActualStep)
                {
                    case 1:
                        this.ActualKonto = "";
                        this.CurrentBMWHeaderID = -1;
                        this.txtStatus.Font = new Font(FontFamily.GenericSansSerif, 10f, FontStyle.Regular);
                        this.txtStatus.Text = "Lade Login-Seite...";
                        this.webB.ScriptErrorsSuppressed = true;
                        this.webB.Navigate(new Uri("https://banking.bmwbank.de/haendler"));
                        this.ActualStep++;
                        break;

                    case 2:
                        if (!Conversions.ToBoolean(this.IdentifySite("PWChange", "method", "post")))
                        {
                            this.ShowUnexpectedSiteError();
                            break;
                        }
                        this.ActualStep++;
                        this.txtStatus.Font = new Font(FontFamily.GenericSansSerif, 10f, FontStyle.Bold);
                        this.txtStatus.Text = "Bitte geben Sie Ihre BMW-Bank-Zugangsdaten ein und klicken Sie auf 'Anmelden'!";
                        this.webB.Visible = true;
                        this.ProgressImage.Visible = false;
                        this.lstKontenrundruf.Visible = false;
                        break;

                    case 3:
                        try
                        {
                            HtmlElementCollection elementsByTagName = this.webB.Document.All["leftNavigation"].GetElementsByTagName("a");
                            bool flag = false;
                            int num8 = elementsByTagName.Count - 1;
                            int num = 0;
                            while (num <= num8)
                            {
                                if (elementsByTagName[num].InnerText == "Vertragsmanagement")
                                {
                                    flag = true;
                                    break;
                                }
                                num++;
                            }
                            if (flag)
                            {
                                this.ActualStep++;
                                elementsByTagName[num].InvokeMember("click");
                                this.webB.Visible = false;
                                this.lstKontenrundruf.Visible = true;
                            }
                            else if (!Conversions.ToBoolean(this.IdentifySite("PWChange", "method", "post")))
                            {
                                this.ShowUnexpectedSiteError();
                            }
                        }
                        catch (NullReferenceException exception1)
                        {
                            ProjectData.SetProjectError(exception1);
                            NullReferenceException ex = exception1;
                            if (!Conversions.ToBoolean(this.IdentifySite("PWChange", "method", "post")))
                            {
                                this.ShowUnexpectedSiteError(ex);
                            }
                            ProjectData.ClearProjectError();
                        }
                        break;

                    case 4:
                        try
                        {
                            HtmlElementCollection elements2 = this.webB.Document.All["leftNavigation"].GetElementsByTagName("a");
                            bool flag2 = false;
                            int num9 = elements2.Count - 1;
                            int num2 = 0;
                            while (num2 <= num9)
                            {
                                if (elements2[num2].InnerText == "Vertragsübersicht")
                                {
                                    flag2 = true;
                                    break;
                                }
                                num2++;
                            }
                            if (flag2)
                            {
                                this.ActualStep++;
                                elements2[num2].InvokeMember("click");
                                this.webB.Visible = false;
                                this.lstKontenrundruf.Visible = true;
                            }
                            else if (!Conversions.ToBoolean(this.IdentifySite("PWChange", "method", "post")))
                            {
                                this.ShowUnexpectedSiteError();
                            }
                        }
                        catch (NullReferenceException exception6)
                        {
                            ProjectData.SetProjectError(exception6);
                            NullReferenceException exception2 = exception6;
                            if (!Conversions.ToBoolean(this.IdentifySite("PWChange", "method", "post")))
                            {
                                this.ShowUnexpectedSiteError(exception2);
                            }
                            ProjectData.ClearProjectError();
                        }
                        break;

                    case 5:
                    {
                        this.ActualKonto = "";
                        this.CurrentBMWHeaderID = -1;
                        int num10 = this.KontenRundrufListe.Count - 1;
                        for (int i = 0; i <= num10; i++)
                        {
                            if (!this.KontenRundrufListe[i].Fehler & !this.KontenRundrufListe[i].Done)
                            {
                                this.ActualKonto = this.KontenRundrufListe[i].Konto.Trim();
                                this.txtStatus.Font = new Font(FontFamily.GenericSansSerif, 10f, FontStyle.Regular);
                                this.txtStatus.Text = "Rufe Kontoauszüge für Konto " + this.ActualKonto + " ab ...";
                                this.ProgressImage.Visible = true;
                                break;
                            }
                        }
                        if (this.ActualKonto == "")
                        {
                            this.ActualStep = 7;
                            return;
                        }
                        try
                        {
                            bool flag3 = false;
                            int num4 = -1;
                            HtmlElementCollection elements4 = null;
                            HtmlElementCollection elements3 = this.webB.Document.All["slDebitorAccount"].GetElementsByTagName("option");
                            flag3 = false;
                            int num11 = elements3.Count - 1;
                            num4 = 0;
                            while (num4 <= num11)
                            {
                                if (elements3[num4].InnerText.Trim() == this.ActualKonto.Trim())
                                {
                                    flag3 = true;
                                    break;
                                }
                                num4++;
                            }
                            if (!flag3)
                            {
                                foreach (KontenRundrufData data in this.KontenRundrufListe)
                                {
                                    if (data.Konto.Trim() == this.ActualKonto.Trim())
                                    {
                                        data.Fehler = true;
                                        this.SetListViewItem(data.Konto, "Konto nicht gefunden!", 2);
                                    }
                                }
                            }
                            else
                            {
                                this.webB.Document.All["slDebitorAccount"].SetAttribute("value", elements3[num4].GetAttribute("value"));
                                this.webB.Document.All["slTablePageSize"].SetAttribute("value", "4");
                                elements4 = this.webB.Document.GetElementsByTagName("a");
                                int num12 = elements4.Count - 1;
                                for (num4 = 0; num4 <= num12; num4++)
                                {
                                    if (elements4[num4].InnerText == "Verträge anzeigen")
                                    {
                                        this.ActualStep++;
                                        elements4[num4].InvokeMember("click");
                                        return;
                                    }
                                }
                            }
                        }
                        catch (NullReferenceException exception7)
                        {
                            ProjectData.SetProjectError(exception7);
                            NullReferenceException exception3 = exception7;
                            this.ShowUnexpectedSiteError(exception3);
                            ProjectData.ClearProjectError();
                        }
                        return;
                    }
                    case 6:
                        try
                        {
                           
                            bool flag4 = false;
                            int num5 = -1;
                            HtmlElementCollection elements5 = null;
                            if (this.webB.DocumentText.Contains("Verarbeitungsfehler") & this.webB.DocumentText.Contains("??????"))
                            {
                                if (this.ErrBridgeCounter < 3)
                                {
                                    this.ErrBridgeCounter++;
                                    elements5 = this.webB.Document.All["leftNavigation"].GetElementsByTagName("a");
                                    flag4 = false;
                                    int num13 = elements5.Count - 1;
                                    for (num5 = 0; num5 <= num13; num5++)
                                    {
                                        if (elements5[num5].InnerText == "Vertragsübersicht")
                                        {
                                            this.txtStatus.Font = new Font(FontFamily.GenericSansSerif, 10f, FontStyle.Regular);
                                            this.txtStatus.Text = "Erneuter Versuch: Rufe Kontoauszüge für Konto " + this.ActualKonto + " ab ...";
                                            this.ActualStep = 5;
                                            elements5[num5].InvokeMember("click");
                                            break;
                                        }
                                    }
                                }
                                if ((this.ErrBridgeCounter > 3) | !flag4)
                                {
                                    this.SetListViewItem(this.ActualKonto, "Fehler beim Abrufen!", 2);
                                    Interaction.MsgBox("Fehler beim Abrufen der Kontodaten.\r\nVorgang wird abgebrochen.", MsgBoxStyle.Critical, "Schwerer Fehler");
                                    this.TheTimer.Enabled = false;
                                    this.Close();
                                    break;
                                }
                            }
                            this.CurrentBMWHeaderID = MyProject.Forms.Main.cs.GetBMWHeaderID(Convert.ToInt64(this.ActualKonto));
                            DataView view = new DataView(MyProject.Forms.Main.cs.Table_BMWBankDetails, "BMW_Header_ID=" + this.CurrentBMWHeaderID.ToString(), "", DataViewRowState.CurrentRows);
                            IEnumerator enumerator = view.GetEnumerator();
                            
                            try
                            {
                                
                                while (enumerator.MoveNext())
                                {
                                    DataRowView current = (DataRowView) enumerator.Current;
                                    ((DatenschemaBMW.TAB_BMW_Bank_DetailsRow) current.Row).Delete();
                                }
                            }
                            finally
                            {
                                if (enumerator is IDisposable)
                                {
                                    (enumerator as IDisposable).Dispose();
                                }
                            }
                            MyProject.Forms.Main.cs.Table_BMWBankDetails.AcceptChanges();
                            HtmlElementCollection elements6 = this.webB.Document.GetElementsByTagName("tr");
                            IEnumerator enumerator3 =  elements6.GetEnumerator();
                            try
                            {
                                
                                while (enumerator3.MoveNext())
                                {
                                    HtmlElement element = (HtmlElement) enumerator3.Current;
                                    string str5 = "";
                                    string str6 = "";
                                    string str4 = "";
                                    string str2 = "";
                                    string str = "";
                                    string str3 = "";

                                    IEnumerator enumerator4 = element.Children.GetEnumerator();

                                    try
                                    {
                                        while (enumerator4.MoveNext())
                                        {
                                            HtmlElement element2 = (HtmlElement) enumerator4.Current;
                                            string attribute = element2.GetAttribute("headers");
                                            if (attribute == "searchresult:creditnumber")
                                            {
                                                str5 = element2.InnerText.Trim();
                                            }
                                            else
                                            {
                                                if (attribute == "searchresult:creditstart")
                                                {
                                                    str4 = element2.InnerText.Trim();
                                                    continue;
                                                }
                                                if (attribute == "searchresult:chassisnumber")
                                                {
                                                    str2 = element2.InnerText.Trim();
                                                    continue;
                                                }
                                                if (attribute == "searchresult:creditsaldo")
                                                {
                                                    str6 = element2.InnerText.Replace("€", "").Trim();
                                                    continue;
                                                }
                                                if (attribute == "searchresult:financingType")
                                                {
                                                    str = element2.InnerText.Trim();
                                                    continue;
                                                }
                                                if (attribute == "searchresult:carType")
                                                {
                                                    str3 = element2.InnerText.Trim();
                                                }
                                            }
                                        }
                                    }
                                    finally
                                    {
                                        if (enumerator4 is IDisposable)
                                        {
                                            (enumerator4 as IDisposable).Dispose();
                                        }
                                    }
                                    if (((str2 != "") & (str5 != "")) & (str6 != ""))
                                    {
                                        this.CurrentBMWHeaderID = MyProject.Forms.Main.cs.GetBMWHeaderID(Convert.ToInt64(this.ActualKonto));
                                        DatenschemaBMW.TAB_BMW_Bank_DetailsRow row = (DatenschemaBMW.TAB_BMW_Bank_DetailsRow) MyProject.Forms.Main.cs.Table_BMWBankDetails.NewRow();
                                        DatenschemaBMW.TAB_BMW_Bank_DetailsRow row3 = row;
                                        row3.BMW_Header_ID = this.CurrentBMWHeaderID;
                                        row3.Kredit_Nr = str5;
                                        row3.Kredit_Beginn = Conversions.ToDate(str4);
                                        row3.FGST_Nr = str2;
                                        row3.FA_Art = str;
                                        row3.FZG_Typ = str3;
                                        row3.Kredit_Saldo = Conversions.ToDouble(str6);
                                        row3.Bemerkung = "";
                                        row3 = null;
                                        MyProject.Forms.Main.cs.Table_BMWBankDetails.Rows.Add(row);
                                    }
                                }
                            }
                            finally
                            {
                                if (enumerator3 is IDisposable)
                                {
                                    (enumerator3 as IDisposable).Dispose();
                                }
                            }
                            MyProject.Forms.Main.cs.Table_BMWBankDetails.AcceptChanges();
                            this.ErrBridgeCounter = 0;
                            foreach (KontenRundrufData data2 in this.KontenRundrufListe)
                            {
                                if (data2.Konto.Trim() == this.ActualKonto.Trim())
                                {
                                    data2.Done = true;
                                    this.SetListViewItem(data2.Konto, "Konto erfolgreich abgrufen!", 1);
                                }
                            }
                            this.ActualStep = 5;
                            this.CurrentBMWHeaderID = -1;
                        }
                        catch (NullReferenceException exception8)
                        {
                            ProjectData.SetProjectError(exception8);
                            NullReferenceException exception4 = exception8;
                            this.ShowUnexpectedSiteError(exception4);
                            ProjectData.ClearProjectError();
                        }
                        break;

                    case 7:
                    {
                        MyProject.Forms.Main.cs.Table_BMWBankDetails.AcceptChanges();
                        bool flag5 = false;
                        foreach (KontenRundrufData data3 in this.KontenRundrufListe)
                        {
                            if (!data3.Fehler & !data3.Done)
                            {
                                flag5 = true;
                                break;
                            }
                        }
                        if (flag5)
                        {
                            try
                            {
                                this.ActualStep = 4;
                            }
                            catch (NullReferenceException exception9)
                            {
                                ProjectData.SetProjectError(exception9);
                                NullReferenceException exception5 = exception9;
                                this.ShowUnexpectedSiteError(exception5);
                                ProjectData.ClearProjectError();
                            }
                        }
                        else
                        {
                            this.txtStatus.Font = new Font(FontFamily.GenericSansSerif, 10f, FontStyle.Bold);
                            this.txtStatus.Text = "Kontenrundruf abgeschloßen!";
                            this.TheTimer.Enabled = false;
                            this.ProgressImage.Visible = false;
                            this.AbortButton.Text = "Schließen";

                            HtmlElementCollection elements7 = this.webB.Document.All["leftNavigation"].GetElementsByTagName("a");
                            int num14 = elements7.Count - 1;
                            for (int j = 0; j <= num14; j++)
                            {
                                if (elements7[j].InnerText == "Abmelden")
                                {
                                    elements7[j].InvokeMember("click");
                                    bool flag6 = true;
                                    while (flag6)
                                    {
                                        flag6 = false;
                                        if (this.webB.IsBusy | (this.webB.ReadyState != WebBrowserReadyState.Complete))
                                        {
                                            flag6 = true;
                                        }
                                    }
                                    break;
                                }
                            }
                            this.Close();
                        }
                        return;
                    }
                }
            }
        }

        internal virtual Button AbortButton
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AbortButton;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.AbortButton_Click);
                if (this._AbortButton != null)
                {
                    this._AbortButton.Click -= handler;
                }
                this._AbortButton = value;
                if (this._AbortButton != null)
                {
                    this._AbortButton.Click += handler;
                }
            }
        }

        internal virtual ListView lstKontenrundruf
        {
            [DebuggerNonUserCode]
            get
            {
                return this._lstKontenrundruf;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._lstKontenrundruf = value;
            }
        }

        internal virtual PictureBox ProgressImage
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ProgressImage;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ProgressImage = value;
            }
        }

        internal virtual Timer TheTimer
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TheTimer;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TheTimer_Tick);
                if (this._TheTimer != null)
                {
                    this._TheTimer.Tick -= handler;
                }
                this._TheTimer = value;
                if (this._TheTimer != null)
                {
                    this._TheTimer.Tick += handler;
                }
            }
        }

        internal virtual Label txtDebug
        {
            [DebuggerNonUserCode]
            get
            {
                return this._txtDebug;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._txtDebug = value;
            }
        }

        internal virtual Label txtStatus
        {
            [DebuggerNonUserCode]
            get
            {
                return this._txtStatus;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._txtStatus = value;
            }
        }

        internal virtual WebBrowser webB
        {
            [DebuggerNonUserCode]
            get
            {
                return this._webB;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._webB = value;
            }
        }
    }
}

